import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '@/pages/Home'
import Standard from '@/pages/Standard'
import Product from '@/pages/Product'
import ServiceDetails from '@/pages/ServiceDetails'
import OrderDetails from '@/pages/OrderDetails'
import Order from '@/pages/Order'
import Binding from '@/pages/Binding'
import ErrorPage from '@/pages/Error'

const routes = [
  { path: '/', component: Home }, // 首页
  { path: '/standard', component: Standard }, // 达标列表页
  { path: '/product', component: Product }, // 兑换产品列表页
  { path: '/serviceDetails', component: ServiceDetails }, // 服务细则
  { path: '/orderDetails', component: OrderDetails }, // 订单详情
  { path: '/order', component: Order }, // 订单列表
  { path: '/binding', component: Binding }, // 绑定成功页
  { path: '/error', component: ErrorPage } // 请求错误页
]

export default createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes // `routes: routes` 的缩写
})
